<template>
  <button 
    v-for="(item , index) in routerLink" 
    @click="navigateTo(item.path)"
    :key="index">
    {{ item.name }}
  </button>
  <router-view />
</template>

<script lang="ts">
import routerList from "@src/router/routerList";
import { defineComponent, reactive } from "vue";

export default defineComponent({
  name: "App",
  setup() {
    const routerLink = reactive(routerList);
    return {
      routerLink,
    };
  },
  methods: {
    navigateTo(path: string) {
      this.$router.push(path)
    }
  }
});
</script>

<style>
body {
  margin: 0;
  padding: 0;
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: white;
  background: #2c3e50;
  margin-top: 60px;
}
</style>